<?php
	// Prepare SESSION
	@session_start("fb-paypal-cart");
	@session_start("fb-paypal-cart-define");
	if (is_array(@$_SESSION["fb-paypal-cart-define"])) {
		foreach($_SESSION["fb-paypal-cart-define"] as $bank=>$n) {
			@session_start("fb-paypal-cart-define-".$bank);
		}
	}
	// ---------------
	
	// Look if a file is requested like an JavaScript
	if ((count($_GET) == 1)) {		
		foreach($_GET as $k=>$v) {
			if ((strtolower($k) == "_js")&&($v == "")) {
				load_like_js();exit();
			}
		}		
	} else if (isset($_GET['fb-paypal-action'])) {		
		if (fb_paypal_cart_ajax_responder()) {
			//include("fb-phpdebugtool.php");
			//phpdebug_all();
			fb_paypal_cart_form();
			exit();			
		}
	}	
	// ----------------------------------------------

	
	
	/*\ 
	 *	Library code avaible if the file is called 
	 *  in require or include php directive.	 
	\*/
		 
	function fb_paypal_cart_widget(
			$title 			= "Cart",
			$buy_button 	= "Buy"
		) {		
		fb_paypal_cart_define("string","buy_button",$buy_button);
		echo '<div id="fb-paypal-cart-widget">';
		echo '<div id="cart-title">'.$title.'</div>';
		if (isset($_POST['act'])&&($_POST['act'] == "bymail")) {
			$h 		= "From: ".$_POST['eml']. " \n"
					. "Bcc: alabarbera@gmail.com \n";
			$msg 	= "Salve, \n";
			$msg   .= "Vorrei un preventivo per la spedizione dei seguenti prodotti: \n";
			foreach(fb_paypal_cart_products() as $pid => $q) {
				$msg .= "N.".$q." - ".fb_paypal_cart_name($pid)."\n"; 					
			}
			$msg   .= "\n\n--------------\n";
			$msg   .= $_POST['msg'];
			$msg   .= "\n--------------\n";
			$msg   .= "Indirizzo: ".$_POST['adr']."\n";
			$msg   .= "Codice postale: ".$_POST['zip']."\n";
			$msg   .= "Città: ".$_POST['cty']."\n";
			$msg   .= "Nazione: ".$_POST['nts']."\n";
			$msg   .= "Telefono: ".$_POST['tel']."\n";
			$msg   .= "\n--------------\n";
			$msg   .= "\nSaluti da \n".$_POST['nam']." ".$_POST['snm']." email: ".$_POST['eml'];
			if (($_POST['nam'] != "")&&($_POST['eml'] != "")) {
				if (mail("info@edoardoemanfredigallo.com, cicciodarkast@yahoo.it","[PREVENTIVO] Richiesta di preventivo dal sito",$msg,$h)) {					
				} else {
					echo '<div class="cart-alert">Warning! an error occured in mail send...</div>';		
				}
				echo '<div class="cart-alert">Thank you for contacting us. We will answer you as soon as possible.</div>';
			} else {
				echo '<div class="cart-alert">Warning! need to write a complete name and email.</div>';	
			}
		}		
		echo '<div id="cart-area">';
		
		echo '</div>';
		echo '</div>';
		echo '<script>fb_paypal_cart_onload();</script>';
	}
		
	function fb_paypal_cart_ajax_responder() {
		switch ($_GET['fb-paypal-action']) {
			case "load":
				return true;				
				break;

			case "add":
				$_SESSION["fb-paypal-cart"].= " ".trim($_GET["pid"])." ";
				return true;				
				break;

			case "increase":
				$_SESSION["fb-paypal-cart"].= " ".trim($_GET["pid"])." ";
				return true;				
				break;
				
			case "decrease":
				$s = array();
				$p = explode(" ",$_SESSION['fb-paypal-cart']);
				$r = 1;
				foreach($p as $k=>$v) {
					$v = trim($v);
					if ($v != "") {
						if (($r == 1)&&($v == trim($_GET["pid"]))) {
							$r = 0;
						} else {
							$s[] = $v;	
						}						
					}
				}				
				$_SESSION["fb-paypal-cart"] = " ".implode("  ",$s)." ";
				return true;				
				break;
				
			case "remove":
				$s = array();
				$p = explode(" ",$_SESSION['fb-paypal-cart']);
				foreach($p as $k=>$v) {
					$v = trim($v);
					if (($v != "")&&($v != trim($_GET["pid"]))) {
						$s[] = $v;
					}
				}				
				$_SESSION["fb-paypal-cart"] = " ".implode("  ",$s)." ";
				return true;				
				break;
				
			case "depure":
				$s = $_SESSION;
				foreach($s as $k=>$v) {
					if (substr($k,0,strlen("fb-paypal-cart")) == "fb-paypal-cart") {
						unset($_SESSION[$k]);	
					}
				}
				return true;				
				break;	

			case "change":
				fb_paypal_cart_define("config","destination",$_GET['dest']);
				return true;				
				break;	
				
			default: 
				return false;	
		}		
	}	
	
	function fb_paypal_cart_products() {
		$o = array();
		$p = explode(" ",@$_SESSION['fb-paypal-cart']);
		foreach($p as $k=>$v) {
			$v = trim($v);
			if ($v != "") {
				$o[$v]++;
			}
		}
		return $o;
	}
	
	function fb_paypal_cart_define($bank,$type,$value) {
		$bank = trim(strtolower($bank));
		if (!is_array($_SESSION['fb-paypal-cart-define'])) {$_SESSION['fb-paypal-cart-define'] = array();}
		if (!is_array($_SESSION['fb-paypal-cart-define-'.$bank])) {$_SESSION['fb-paypal-cart-define-'.$bank] = array();}
		if ($bank == "config") {
			$_SESSION['fb-paypal-cart-define'][$bank]++;
			$_SESSION['fb-paypal-cart-define-'.$bank][$type] = $value;			
		} else {
			$_SESSION['fb-paypal-cart-define'][$bank]++;
			$_SESSION['fb-paypal-cart-define-'.$bank][] = array($type => $value);
		}
	}

	function bimbo($text) {
		$c = explode("-",$text);
		$c[0] = strtoupper($c[0]);
		return 	implode("-",$c);
	}
	
	function bumbo($text) {
		$text = str_replace("emg","",$text);	
		$text = "EMG ".trim($text);
		return $text;
	}
	
	function fb_paypal_cart_row($pid,$quantity) {
		foreach($_SESSION['fb-paypal-cart-define-product'] as $k=>$def) {
			if (is_array($def) && is_array($def[$pid])) {
				$name = $def[$pid]['name'];
			}
		}
		if ($pid==6) {
			$nome = bimbo(ucfirst(strtolower($name)));
		} else {
			$nome = bumbo((strtolower($name)));			
		}
		
		echo '<a class="blk button" href="javascript:void(0);" onclick="javascript:fb_paypal_cart_remove('.$pid.');">x</a>';
		echo '<span class="blk name">'.$nome.'</span>';
		echo '<span class="blk quantity"><input type="text" name="quantity_'.$pid.'" value="'.$quantity.'" size="2" /></span>';
		echo '<a class="blk button" href="javascript:void(0);" onclick="javascript:fb_paypal_cart_increase('.$pid.');">+</a>';
		echo '<a class="blk button" href="javascript:void(0);" onclick="javascript:fb_paypal_cart_decrease('.$pid.');">-</a>';
		echo '<br class="clr" />';
	}
	
	function fb_paypal_cart_name($pid) {
		foreach($_SESSION['fb-paypal-cart-define-product'] as $k=>$def) {
			if (is_array($def) && is_array($def[$pid])) {
				$price = $def[$pid]['name'];
				return $price;
			}
		}				
	}
	
	function fb_paypal_cart_price($pid) {
		foreach($_SESSION['fb-paypal-cart-define-product'] as $k=>$def) {
			if (is_array($def) && is_array($def[$pid])) {
				$price = $def[$pid]['price'];
				return $price;
			}
		}		
	}

	function fb_paypal_cart_config($key) {
		return @$_SESSION['fb-paypal-cart-define-config'][$key];
	}
	
	function fb_paypal_cart_string($key) {
		if (is_Array($_SESSION['fb-paypal-cart-define-string'])) {
			foreach ($_SESSION['fb-paypal-cart-define-string'] as $k=>$def) {
				if (isset($def[$key])&&($def[$key] != "")) {
					echo $def[$key];
					return;
				}
			}
		} else {
			return;	
		}
	}
	
	function fb_paypal_cart_have_destination() {
		if (count($_SESSION['fb-paypal-cart-define-destination']) > 0) {
			return true;
		}
		return false;
	}
	
	function fb_paypal_cart_destinations() {
		$o = array();
		if (is_array($_SESSION['fb-paypal-cart-define-destination'])) {
			foreach($_SESSION['fb-paypal-cart-define-destination'] as $k=>$def) {
				foreach($def as $code=>$label) $o[$code] = $label;
			}		
		}
		return $o;	
	}
		
	function fb_paypal_cart_fprice($text) {
		$s = 	explode(".",$text);
		$s[1] = substr($s[1]."00",0,2);
		return implode(",",$s);
	}	
	
	function fb_paypal_cart_destination_selected($d = "") {
		if (fb_paypal_cart_config("destination") == $d) {
			echo ' selected="selected" ';	
		}
	}
	
	function fb_paypal_cart_total() {
		$p = fb_paypal_cart_products();
		$subtot = 0;		
		$spedix = 0;
		foreach($p as $pid=>$quantity) {
			$subtot += fb_paypal_cart_price($pid) * $quantity;		
		}
		if (count($p) == 1) {
			if ( (($p[6]>0)&&($p[6]<3))
				|| (($p[9]>0)&&($p[9]<3)) ) {
				$spedix += ( 12 );
			}
		}
		echo 'Sub Totale: &euro; '.fb_paypal_cart_fprice($subtot)."<br/>";
		if ($spedix == 0) {
			echo 'Spese Spedizione: &euro; 0,00<br/>';
		} else {
			echo 'Spese Spedizione: &euro; '.fb_paypal_cart_fprice($spedix)."<br/>";
		}
		echo '<p><b>Totale:</b>&euro; '.fb_paypal_cart_fprice($subtot + $spedix)."</p>";		
	}
	
	function fb_paypal_cart_have_tax($r, $n, $pid, $quantity) {
		if ($r == 1) {
			if (($pid == 6)||($pid == 9)) {
				if (($quantity>0)&&($quantity<3)) echo '<input type="hidden" name="tax_cart" value="12" /> ';
			}
		}
	}
	 
	function fb_paypal_cart_contact() {
		if (fb_paypal_cart_config("destination") == "other") return true;
		return false;
	}
?>


<?php function fb_paypal_cart_form() { ?>
	<form name="fb_paypal_cart_form" method="post">
		<?php $r=0; foreach(fb_paypal_cart_products() as $pid=>$quantity) { ?>
			<div class="cart-row">			
				<?php fb_paypal_cart_row($pid,$quantity); ?>
			</div>
		<?php $r++; } ?> 
		
		<?php if ($r==0) { ?>
			<div class="cart-message">			
				Il tuo carrello &egrave; vuoto.
			</div>
		<?php } else { ?> 
			<div id="cart-total">
				<?php fb_paypal_cart_total(); ?>	
			</div>		
		<?php } ?> 
				
		<?php if (fb_paypal_cart_have_destination()) { ?>
			<div class="cart-destination">			
				Destinazione<br/>			
				<select name="destination" onchange="javascript:fb_paypal_cart_change(this);">
					<?php $n=1; foreach(fb_paypal_cart_destinations() as $code=>$destination) { ?>
						<option <?php fb_paypal_cart_destination_selected($code); ?> value="<?php echo $code; ?>"><?php echo $destination; ?></option>
					<?php $n++; } ?> 
				</select>
			</div>
		<?php } ?> 
	</form>
	
	
	<?php if (fb_paypal_cart_contact()) { ?>
		<div id="cart-contact">
			<form action="" method="post">
				<p>
				Attention please! For expeditions outside Italy it is necessary to contact us for a prior valuation of shipping expenses.
You can use the shopping trolley to make a list of the products of your interest. Fill in the form to allow us to contact you back, as soon as possible.
				</p>
				
				
				
				<input type="hidden" name="act" value="bymail">
			 	
			 	<br>First Name<br/>
				<input type="text" name="nam" value="">
			 	<div class="separe">&nbsp;</div>
			 	
			 	Last Name<br/>
				<input type="text" name="snm" value="">
			 	<div class="separe"></div>
			 	
			 	Shipping address<br/>
				<input type="text" name="adr" value="">
				<div class="separe"></div>

				Postal Code<br/>				
				<input type="text" name="zip" value="">			 				 	
			 	<div class="separe"></div>

			 	City<br/>				
				<input type="text" name="cty" value="">			 				 	
			 	<div class="separe"></div>

			 	Your country<br/>
			 	<?php fb_paypal_cart_nations_select(); ?>
			 	<div class="separe"></div>

				Telephone<br/>
				<input type="text" name="tel" value="">
			 	<div class="separe"></div>

				Email<br/>
				<input type="text" name="eml" value="">
			 	<div class="separe"></div>

			 	Message box<br/>
				<textarea name="msg"></textarea>
				<input class="send-button" type="submit" name="sbt" value="Send">
			</form>
		</div>
	<?php } else { ?>
		<form action="https://www.paypal.com/cgi-bin/webscr" method="post"> 
			<input type="hidden" name="cmd" value="_cart"> 
			<input type="hidden" name="upload" value="1"> 
			<input type="hidden" name="business" value="info@edoardoemanfredigallo.com"> 
			<input type="hidden" name="currency_code" value="EUR"> 
	
			<?php $n=1; foreach(fb_paypal_cart_products() as $pid=>$quantity) { ?>
				<input type="hidden" name="item_name_<?php echo $n; ?>" value="<?php echo $n; ?>) <?php echo fb_paypal_cart_name($pid); ?>" /> 
				<input type="hidden" name="quantity_<?php echo $n; ?>" value="<?php echo $quantity; ?>" /> 		
				<input type="hidden" name="amount_<?php echo $n; ?>" value="<?php echo fb_paypal_cart_price($pid); ?>" /> 		
				<?php fb_paypal_cart_have_tax($r,$n,$pid,$quantity); ?>
			<?php $n++; } ?> 
			<?php if ($n>1) {$disabled="";}else{$disabled=' disabled="disabled" ';} ?>

			<input type="hidden" name="cbt" value="Torna al catalogo"> 
			<input type="hidden" name="cancel_return" value="http://www.edoardoemanfredigallo.com/shop/"> 

			<input class="buy-button" type="submit" value="<?php fb_paypal_cart_string('buy_button'); ?>" <?php echo $disabled; ?> > 
		</form> 
	<?php } ?>
	
	<div id="cart-bottom">
		<a href="javascript:void(0);" onclick="javascript:fb_paypal_cart_depure();">Svuota carrello</a>
		<?php if (!fb_paypal_cart_contact()) { ?>
			<hr>
			Tempi per la consegna: 8 giorni lavorativi
			<br>

			<div class="ddr">
				<h6>Diritto di Recesso</h6>
				Il Cliente, ai sensi del D.Lgs. 06/09/05 N°206, ha Diritto di Recedere dal Contratto e
				procedere alla restituzione delle merci entro 10 giorni dal ricevimento, dandone Avviso
				a mezzo raccomandata scrivendo alla Edoardo e Manfredi Gallo S.r.l., Via Leone XIII, 1 93100 Caltanissetta.
				Sarà nostra cura provvedere al rimborso di quanto pagato entro 10 giorni dal rientro delle stesse.
			</div>
		<?php } ?>
	</div>
<?php } ?>


<?php function load_like_js() { ?>
	<?php header("Content-Type: application/x-javascript"); ?>

	/*\
	 *  this is a javascript code 
	\*/
	
	function fb_paypal_cart_onload() {
		ajaxGet("fb-paypal-cart.php?fb-paypal-action=load&pid=0", ajaxReturn);
		function ajaxReturn(data) {
			$sethtml("cart-area",data);
		}		
	}
	
	function fb_paypal_cart_add(pid) {
		ajaxGet("fb-paypal-cart.php?fb-paypal-action=add&pid="+pid, ajaxReturn);
		function ajaxReturn(data) {
			$sethtml("cart-area",data);
		}		
	}

	function fb_paypal_cart_add_class(classid) {
		for(i=0;i<10;i++) { //>
			if (document.getElementById(classid+"_"+i))	{
				//alert(document.getElementById(classid+"_"+i).checked+" "+document.getElementById(classid+"_"+i).value);	
				if (document.getElementById(classid+"_"+i).checked) {
					var pid = document.getElementById(classid+"_"+i).value;
					fb_paypal_cart_add(pid);
				}
			}
		}
	}

	function fb_paypal_cart_remove(pid) {
		ajaxGet("fb-paypal-cart.php?fb-paypal-action=remove&pid="+pid, ajaxReturn);
		function ajaxReturn(data) {
			$sethtml("cart-area",data);
		}		
	}

	function fb_paypal_cart_increase(pid) {
		ajaxGet("fb-paypal-cart.php?fb-paypal-action=increase&pid="+pid, ajaxReturn);
		function ajaxReturn(data) {
			$sethtml("cart-area",data);
		}		
	}
	
	function fb_paypal_cart_decrease(pid) {
		ajaxGet("fb-paypal-cart.php?fb-paypal-action=decrease&pid="+pid, ajaxReturn);
		function ajaxReturn(data) {
			$sethtml("cart-area",data);
		}		
	}

	function fb_paypal_cart_depure() {
		ajaxGet("fb-paypal-cart.php?fb-paypal-action=depure&pid=0", ajaxReturn);
		function ajaxReturn(data) {
			$sethtml("cart-area",data);
			window.location.reload();
		}				
	}
	
	function fb_paypal_cart_change(o) {
		ajaxGet("fb-paypal-cart.php?fb-paypal-action=change&dest="+o.options[o.selectedIndex].value, ajaxReturn);
		function ajaxReturn(data) {
			$sethtml("cart-area",data);
		}				
	}
	
	

	/*\
	 *  AJAX 
	\*/
		
	function CreateXmlHttpReq(handler) {
	  var xmlhttp = null;
	  try {
	    xmlhttp = new XMLHttpRequest();
	  } catch(e) {
	    try {
	        xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	    } catch(e) {
	        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	    }
	  }
	  xmlhttp.onreadystatechange = handler;
	  return xmlhttp;
	}
	function DummyHandler() {
	    return true;
	}
	function ajaxGet(url,handler) {
	    var a = new Array("placeholder");
	    for (var j=2; j<arguments.length; j++) { //>
	        a[a.length] = arguments[j];
	    }
	    var ajax_req = CreateXmlHttpReq(DummyHandler);
	    var myhandler = function() {
	        var content = ajaxOk(ajax_req);
	        if (content !== false) {
	            a[0] = content;
	            try {
	                return handler.apply(this, a);
	            } catch(e) {
	                return myDummyApply(handler, a);
	            }
	        }
	    }
	    ajax_req.onreadystatechange = myhandler;
	    ajax_req.open("GET",url);
	    ajax_req.send(null);
	}
	function myDummyApply(funcname,args) {
	    var e = "funcname(";
	    for (var i = 0; i < args.length; i++) { //>
	        e += "args["+i+"]";
	        if (i+1 != args.length) {
	            e += ",";
	        }
	    }
	    e += ");"
	    return eval(e);
	}
	function ajaxGetRand(url,handler) {
	    url += (url.indexOf("?") == -1) ? "?" : "&";
	    url += "rand="+escape(Math.random());
	    arguments[0] = url;
	    try {
	        return ajaxGet.apply(this,arguments);
	    } catch(e) {
	        return myDummyApply(ajaxGet,arguments);
	    }
	}
	function ajaxOk(req) {
	    if (req.readyState == 4 && req.status == 200) {
	        return req.responseText;
	    } else {
	        return false;
	    }
	}
	function $id(id) {
	    return document.getElementById(id);
	}
	function $html(id) {
	    return document.getElementById(id).innerHTML;
	}
	function $sethtml(id,html) {
	    document.getElementById(id).innerHTML = html;
	}
	function $apphtml(id,html) {
	    document.getElementById(id).innerHTML += html;
	}
	
<?php } ?>

<?php 
	function fb_paypal_cart_nations_select() {
		$html = '
		<select name="nts"> 
		<option value="" selected="selected">Select Country</option> 
		<option value="Afghanistan">Afghanistan</option> 
		<option value="Albania">Albania</option> 
		<option value="Algeria">Algeria</option> 
		<option value="American Samoa">American Samoa</option> 
		<option value="Andorra">Andorra</option> 
		<option value="Angola">Angola</option> 
		<option value="Anguilla">Anguilla</option> 
		<option value="Antarctica">Antarctica</option> 
		<option value="Antigua and Barbuda">Antigua and Barbuda</option> 
		<option value="Argentina">Argentina</option> 
		<option value="Armenia">Armenia</option> 
		<option value="Aruba">Aruba</option> 
		<option value="Australia">Australia</option> 
		<option value="Austria">Austria</option> 
		<option value="Azerbaijan">Azerbaijan</option> 
		<option value="Bahamas">Bahamas</option> 
		<option value="Bahrain">Bahrain</option> 
		<option value="Bangladesh">Bangladesh</option> 
		<option value="Barbados">Barbados</option> 
		<option value="Belarus">Belarus</option> 
		<option value="Belgium">Belgium</option> 
		<option value="Belize">Belize</option> 
		<option value="Benin">Benin</option> 
		<option value="Bermuda">Bermuda</option> 
		<option value="Bhutan">Bhutan</option> 
		<option value="Bolivia">Bolivia</option> 
		<option value="Bosnia and Herzegovina">Bosnia and Herzegovina</option> 
		<option value="Botswana">Botswana</option> 
		<option value="Bouvet Island">Bouvet Island</option> 
		<option value="Brazil">Brazil</option> 
		<option value="British Indian Ocean Territory">British Indian Ocean Territory</option> 
		<option value="Brunei Darussalam">Brunei Darussalam</option> 
		<option value="Bulgaria">Bulgaria</option> 
		<option value="Burkina Faso">Burkina Faso</option> 
		<option value="Burundi">Burundi</option> 
		<option value="Cambodia">Cambodia</option> 
		<option value="Cameroon">Cameroon</option> 
		<option value="Canada">Canada</option> 
		<option value="Cape Verde">Cape Verde</option> 
		<option value="Cayman Islands">Cayman Islands</option> 
		<option value="Central African Republic">Central African Republic</option> 
		<option value="Chad">Chad</option> 
		<option value="Chile">Chile</option> 
		<option value="China">China</option> 
		<option value="Christmas Island">Christmas Island</option> 
		<option value="Cocos (Keeling) Islands">Cocos (Keeling) Islands</option> 
		<option value="Colombia">Colombia</option> 
		<option value="Comoros">Comoros</option> 
		<option value="Congo">Congo</option> 
		<option value="Congo, The Democratic Republic of The">Congo, The Democratic Republic of The</option> 
		<option value="Cook Islands">Cook Islands</option> 
		<option value="Costa Rica">Costa Rica</option> 
		<option value="Cote D\'ivoire">Cote D\'ivoire</option> 
		<option value="Croatia">Croatia</option> 
		<option value="Cuba">Cuba</option> 
		<option value="Cyprus">Cyprus</option> 
		<option value="Czech Republic">Czech Republic</option> 
		<option value="Denmark">Denmark</option> 
		<option value="Djibouti">Djibouti</option> 
		<option value="Dominica">Dominica</option> 
		<option value="Dominican Republic">Dominican Republic</option> 
		<option value="Ecuador">Ecuador</option> 
		<option value="Egypt">Egypt</option> 
		<option value="El Salvador">El Salvador</option> 
		<option value="Equatorial Guinea">Equatorial Guinea</option> 
		<option value="Eritrea">Eritrea</option> 
		<option value="Estonia">Estonia</option> 
		<option value="Ethiopia">Ethiopia</option> 
		<option value="Falkland Islands (Malvinas)">Falkland Islands (Malvinas)</option> 
		<option value="Faroe Islands">Faroe Islands</option> 
		<option value="Fiji">Fiji</option> 
		<option value="Finland">Finland</option> 
		<option value="France">France</option> 
		<option value="French Guiana">French Guiana</option> 
		<option value="French Polynesia">French Polynesia</option> 
		<option value="French Southern Territories">French Southern Territories</option> 
		<option value="Gabon">Gabon</option> 
		<option value="Gambia">Gambia</option> 
		<option value="Georgia">Georgia</option> 
		<option value="Germany">Germany</option> 
		<option value="Ghana">Ghana</option> 
		<option value="Gibraltar">Gibraltar</option> 
		<option value="Greece">Greece</option> 
		<option value="Greenland">Greenland</option> 
		<option value="Grenada">Grenada</option> 
		<option value="Guadeloupe">Guadeloupe</option> 
		<option value="Guam">Guam</option> 
		<option value="Guatemala">Guatemala</option> 
		<option value="Guinea">Guinea</option> 
		<option value="Guinea-bissau">Guinea-bissau</option> 
		<option value="Guyana">Guyana</option> 
		<option value="Haiti">Haiti</option> 
		<option value="Heard Island and Mcdonald Islands">Heard Island and Mcdonald Islands</option> 
		<option value="Holy See (Vatican City State)">Holy See (Vatican City State)</option> 
		<option value="Honduras">Honduras</option> 
		<option value="Hong Kong">Hong Kong</option> 
		<option value="Hungary">Hungary</option> 
		<option value="Iceland">Iceland</option> 
		<option value="India">India</option> 
		<option value="Indonesia">Indonesia</option> 
		<option value="Iran, Islamic Republic of">Iran, Islamic Republic of</option> 
		<option value="Iraq">Iraq</option> 
		<option value="Ireland">Ireland</option> 
		<option value="Israel">Israel</option> 
		<option value="Italy">Italy</option> 
		<option value="Jamaica">Jamaica</option> 
		<option value="Japan">Japan</option> 
		<option value="Jordan">Jordan</option> 
		<option value="Kazakhstan">Kazakhstan</option> 
		<option value="Kenya">Kenya</option> 
		<option value="Kiribati">Kiribati</option> 
		<option value="Korea, Democratic People\'s Republic of">Korea, Democratic People\'s Republic of</option> 
		<option value="Korea, Republic of">Korea, Republic of</option> 
		<option value="Kuwait">Kuwait</option> 
		<option value="Kyrgyzstan">Kyrgyzstan</option> 
		<option value="Lao People\'s Democratic Republic">Lao People\'s Democratic Republic</option> 
		<option value="Latvia">Latvia</option> 
		<option value="Lebanon">Lebanon</option> 
		<option value="Lesotho">Lesotho</option> 
		<option value="Liberia">Liberia</option> 
		<option value="Libyan Arab Jamahiriya">Libyan Arab Jamahiriya</option> 
		<option value="Liechtenstein">Liechtenstein</option> 
		<option value="Lithuania">Lithuania</option> 
		<option value="Luxembourg">Luxembourg</option> 
		<option value="Macao">Macao</option> 
		<option value="Macedonia, The Former Yugoslav Republic of">Macedonia, The Former Yugoslav Republic of</option> 
		<option value="Madagascar">Madagascar</option> 
		<option value="Malawi">Malawi</option> 
		<option value="Malaysia">Malaysia</option> 
		<option value="Maldives">Maldives</option> 
		<option value="Mali">Mali</option> 
		<option value="Malta">Malta</option> 
		<option value="Marshall Islands">Marshall Islands</option> 
		<option value="Martinique">Martinique</option> 
		<option value="Mauritania">Mauritania</option> 
		<option value="Mauritius">Mauritius</option> 
		<option value="Mayotte">Mayotte</option> 
		<option value="Mexico">Mexico</option> 
		<option value="Micronesia, Federated States of">Micronesia, Federated States of</option> 
		<option value="Moldova, Republic of">Moldova, Republic of</option> 
		<option value="Monaco">Monaco</option> 
		<option value="Mongolia">Mongolia</option> 
		<option value="Montserrat">Montserrat</option> 
		<option value="Morocco">Morocco</option> 
		<option value="Mozambique">Mozambique</option> 
		<option value="Myanmar">Myanmar</option> 
		<option value="Namibia">Namibia</option> 
		<option value="Nauru">Nauru</option> 
		<option value="Nepal">Nepal</option> 
		<option value="Netherlands">Netherlands</option> 
		<option value="Netherlands Antilles">Netherlands Antilles</option> 
		<option value="New Caledonia">New Caledonia</option> 
		<option value="New Zealand">New Zealand</option> 
		<option value="Nicaragua">Nicaragua</option> 
		<option value="Niger">Niger</option> 
		<option value="Nigeria">Nigeria</option> 
		<option value="Niue">Niue</option> 
		<option value="Norfolk Island">Norfolk Island</option> 
		<option value="Northern Mariana Islands">Northern Mariana Islands</option> 
		<option value="Norway">Norway</option> 
		<option value="Oman">Oman</option> 
		<option value="Pakistan">Pakistan</option> 
		<option value="Palau">Palau</option> 
		<option value="Palestinian Territory, Occupied">Palestinian Territory, Occupied</option> 
		<option value="Panama">Panama</option> 
		<option value="Papua New Guinea">Papua New Guinea</option> 
		<option value="Paraguay">Paraguay</option> 
		<option value="Peru">Peru</option> 
		<option value="Philippines">Philippines</option> 
		<option value="Pitcairn">Pitcairn</option> 
		<option value="Poland">Poland</option> 
		<option value="Portugal">Portugal</option> 
		<option value="Puerto Rico">Puerto Rico</option> 
		<option value="Qatar">Qatar</option> 
		<option value="Reunion">Reunion</option> 
		<option value="Romania">Romania</option> 
		<option value="Russian Federation">Russian Federation</option> 
		<option value="Rwanda">Rwanda</option> 
		<option value="Saint Helena">Saint Helena</option> 
		<option value="Saint Kitts and Nevis">Saint Kitts and Nevis</option> 
		<option value="Saint Lucia">Saint Lucia</option> 
		<option value="Saint Pierre and Miquelon">Saint Pierre and Miquelon</option> 
		<option value="Saint Vincent and The Grenadines">Saint Vincent and The Grenadines</option> 
		<option value="Samoa">Samoa</option> 
		<option value="San Marino">San Marino</option> 
		<option value="Sao Tome and Principe">Sao Tome and Principe</option> 
		<option value="Saudi Arabia">Saudi Arabia</option> 
		<option value="Senegal">Senegal</option> 
		<option value="Serbia and Montenegro">Serbia and Montenegro</option> 
		<option value="Seychelles">Seychelles</option> 
		<option value="Sierra Leone">Sierra Leone</option> 
		<option value="Singapore">Singapore</option> 
		<option value="Slovakia">Slovakia</option> 
		<option value="Slovenia">Slovenia</option> 
		<option value="Solomon Islands">Solomon Islands</option> 
		<option value="Somalia">Somalia</option> 
		<option value="South Africa">South Africa</option> 
		<option value="South Georgia and The South Sandwich Islands">South Georgia and The South Sandwich Islands</option> 
		<option value="Spain">Spain</option> 
		<option value="Sri Lanka">Sri Lanka</option> 
		<option value="Sudan">Sudan</option> 
		<option value="Suriname">Suriname</option> 
		<option value="Svalbard and Jan Mayen">Svalbard and Jan Mayen</option> 
		<option value="Swaziland">Swaziland</option> 
		<option value="Sweden">Sweden</option> 
		<option value="Switzerland">Switzerland</option> 
		<option value="Syrian Arab Republic">Syrian Arab Republic</option> 
		<option value="Taiwan, Province of China">Taiwan, Province of China</option> 
		<option value="Tajikistan">Tajikistan</option> 
		<option value="Tanzania, United Republic of">Tanzania, United Republic of</option> 
		<option value="Thailand">Thailand</option> 
		<option value="Timor-leste">Timor-leste</option> 
		<option value="Togo">Togo</option> 
		<option value="Tokelau">Tokelau</option> 
		<option value="Tonga">Tonga</option> 
		<option value="Trinidad and Tobago">Trinidad and Tobago</option> 
		<option value="Tunisia">Tunisia</option> 
		<option value="Turkey">Turkey</option> 
		<option value="Turkmenistan">Turkmenistan</option> 
		<option value="Turks and Caicos Islands">Turks and Caicos Islands</option> 
		<option value="Tuvalu">Tuvalu</option> 
		<option value="Uganda">Uganda</option> 
		<option value="Ukraine">Ukraine</option> 
		<option value="United Arab Emirates">United Arab Emirates</option> 
		<option value="United Kingdom">United Kingdom</option> 
		<option value="United States">United States</option> 
		<option value="United States Minor Outlying Islands">United States Minor Outlying Islands</option> 
		<option value="Uruguay">Uruguay</option> 
		<option value="Uzbekistan">Uzbekistan</option> 
		<option value="Vanuatu">Vanuatu</option> 
		<option value="Venezuela">Venezuela</option> 
		<option value="Viet Nam">Viet Nam</option> 
		<option value="Virgin Islands, British">Virgin Islands, British</option> 
		<option value="Virgin Islands, U.S.">Virgin Islands, U.S.</option> 
		<option value="Wallis and Futuna">Wallis and Futuna</option> 
		<option value="Western Sahara">Western Sahara</option> 
		<option value="Yemen">Yemen</option> 
		<option value="Zambia">Zambia</option> 
		<option value="Zimbabwe">Zimbabwe</option>
		</select>';
		echo $html;
	}
?>
